# 封装、继承、多态
# 不同的 子类 调用相同的父类，产生不同的结果
class dog():
    def __init__(self,name):
        self.name = name
    def game(self):
        print('普通的狗，只能简单的玩')
class GodDog(dog):
    def game(self):
        print('神狗要去天上玩...')
class person():
    def __init__(self,name):
        self.name = name

    def game_with_dog(self,which_dog):
        print(f'{self.name}和{which_dog.name}一起玩')
        which_dog.game() #

wangcai = dog(name='旺财')
xtq = GodDog(name='哮天犬')
xiaoming = person('小明')
xiaoming.game_with_dog(which_dog=wangcai)